package org.eevolution.model;

import java.sql.ResultSet;
import java.util.Properties;

import org.compiere.model.MTree_Base;
import org.eevolution.model.X_HR_Department;


public class MHRDepartment extends X_HR_Department {

	/**
	 * 
	 */
	private static final long serialVersionUID = 4222390914934343348L;

	public MHRDepartment(Properties ctx, int HR_Department_ID, String trxName) {
		super(ctx, HR_Department_ID, trxName);
	}

	public MHRDepartment(Properties ctx, ResultSet rs, String trxName) {
		super(ctx, rs, trxName);
	}

	@Override
	protected boolean afterSave(boolean newRecord, boolean success) {
		
		super.afterSave(newRecord, success);
		
		if (newRecord && success)
		{
			// Trees
			insert_Tree(MTree_Base.TREETYPE_Department);
		}
		
		return true;
	}
	
	@Override
	protected boolean afterDelete(boolean success) {
		
		super.afterDelete(success);
		
		if (success)
			delete_Tree(MTree_Base.TREETYPE_Department);
		return success;
	}

}
